package experiment.e05.code.ch04.v2;

import experiment.e05.code.ch04.v0.Point;

/**
 * @author thinkpad - 83start
 * @version v1.0
 * @create 2022/10/13 16:26
 * @package experiment.e05.code.ch04.v2
 * @description 抽象类Shape
 */

public abstract class Shape {
    // 私有属性
    private Point point;

    // 构造方法
    public Shape() {
    }

    public Shape(Point point) {
        this.point = point;
    }

    // get && set
    public Point getPoint() {
        return point;
    }

    public void setPoint(Point point) {
        this.point = point;
    }

    /**
     * 获取面积
     *
     * @return
     */
    public abstract double getArea();

    @Override
    public String toString() {
        return point.toString();
    }
}
